package com.gdhuarui.service;

import com.gdhuarui.mapper.IndexMapper;
import org.springframework.stereotype.Service;
import com.gdhuarui.pojo.*;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.ArrayList;

@Service
public class IndexService {

    @Autowired
    public IndexMapper indexMapper;

    public ArrayList<Config> getConfigs() {return indexMapper.getConfigs();}

    public Page<News> getNewsByCatalog(String catalog) {return indexMapper.getNewsByCatalog(catalog);}

    public Page<Project> getProjectsLimitSix() {
        return indexMapper.getProjectsLimitSix();
    }

    public Page<Partner> getPartnerslimitSix() {
        return indexMapper.getPartnerslimitSix();
    }

    public Page<News> getNewsByCatalogPage(String catalog) {return indexMapper.getNewsByCatalogPage(catalog);}

    public News getNewsById(int id) { return indexMapper.getNewsById(id);}

    public Page<Project> getProjectsPage() {return indexMapper.getProjectsPage();}

    public Page<Product> getProductsPage() {return indexMapper.getProductsPage();}

    public Product getProductById(int id) {return indexMapper.getProductById(id);}
}
